﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web;
using System.Web.Mvc;
namespace Model
{

    [MetadataType(typeof(ContactOrder_Metadata))]
    [DisplayName("ContactOrder")]
    public partial class ContactOrder
    {
        public ContactOrder()
        {
            this.Id = Guid.NewGuid();
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
            this.Number = "Ebyshow" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day +"-" +DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second;
            this.DateTime = DateTime.Now;
        }

        public class ContactOrder_Metadata
        {
            [ScaffoldColumn(false)]
            public Guid Id { get; set; }

            [ScaffoldColumn(false)]
            public object Number { get; set; }

            [DisplayName("订单状态")]
            public object State { get; set; }

            [DisplayName("客户名称")]
            [DropDownList("Customer","Id","CustomerName")]
            public object CustomerId { get; set; }

            [DisplayName("联 系 人")]
            [DropDownList("CustomerContact","Id","Name")]
            public object CustomerContactId { get; set; }

            
            [DisplayName("报价单号")]
            [Required(ErrorMessage="报价单号不能为空")]
            [DropDownList("Quotation","Id","Number")]
            public object QuotationId { get; set; }

            [DisplayName("签约日期")]
            public object ContactDatetime { get; set; }

            [DisplayName("负责人")]
            [DropDownList("Sys_Users","Id","UserName")]
            public object AdminId { get; set; }


            [DisplayName("备注")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            [DataType(DataType.MultilineText)]
            public object Description { get; set; }

            [ScaffoldColumn(false)]
            [DisplayName("添加时间")]
            public object DateTime { get; set; }

            [ScaffoldColumn(false)]
            public Guid UserId { get; set; }

            //[DisplayName("标题")]
            //[Required]
            //public object Title { get; set; }



        }
    }
}
